home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / cmln0985.arc / TABLES.LTG < prev    next >
Text File  |  1986-02-27  |  3KB  |  109 lines

  1.  
  2.  
  3.                         Logic at a Glance
  4.  
  5.                             Listings
  6.  
  7.  
  8.                            Listing 1.  
  9.              'getl' output from Ergo Logic Compiler
  10.  
  11. if (!(length == 1))   {
  12.         if (!(c == '\n'))   {
  13.                 if (!(c == BACKSPACE))   {
  14.                         if (i == length  )   {
  15.                                 beep();
  16.                         }
  17.                         else if (typ == NUMERIC)   {
  18.                                 if (isdigit(c))   {
  19.                                         addch(c);
  20.                                         refresh();
  21.                                         str[i] = c ;
  22.                                         str[i+1]='\0';
  23.                                         i++   ;
  24.                                 }
  25.                                 else {
  26.                                         beep();
  27.                                 }
  28.                         }
  29.                         else {
  30.                                 addch(c);
  31.                                 refresh();
  32.                                 str[i] = c ;
  33.                                 str[i+1]='\0';
  34.                                 i++   ;
  35.                         }
  36.                 }
  37.                 else if (!(i == 0    ))   {
  38.                         backup(1);
  39.                 }
  40.                 else {
  41.                         beep();
  42.                 }
  43.         }
  44.         else {
  45.                 break;
  46.         }
  47. }
  48. else {
  49.         addch(c);
  50.         refresh();
  51.         str[i] = c ;
  52.         str[i+1]='\0';
  53.         break;
  54. }
  55. è
  56.  
  57.  
  58.  
  59.                            Listing 2. 
  60.       'getl' compiled to isolate most frequent rules first
  61.  
  62. if (!(length == 1))   {
  63.         if (!(c == '\n'))   {
  64.                 if (!(c == BACKSPACE))   {
  65.                         if (!(typ == NUMERIC))   {
  66.                                 if (!(i == length  ))   {
  67.                                         addch(c);refresh();
  68.                                         str[i] = c ;
  69.                                         str[i+1]='\0';
  70.                                         i++   ;
  71.                                 }
  72.                                 else  {
  73.                                         beep();
  74.                                 }
  75.                         }
  76.                         else if (!(i == length  ))   {
  77.                                 if (isdigit(c))   {
  78.                                         addch(c);refresh();
  79.                                         str[i] = c ;
  80.                                         str[i+1]='\0';
  81.                                         i++   ;
  82.                                 }
  83.                                 else  {
  84.                                         beep();
  85.                                 }
  86.                         }
  87.                         else  {
  88.                                 beep();
  89.                         }
  90.                 }
  91.                 else if (!(i == 0    ))   {
  92.                         backup(1);
  93.                 }
  94.                 else  {
  95.                         beep();
  96.                 }
  97.         }
  98.         else  {
  99.                 break;
  100.         }
  101. }
  102. else  {
  103.         addch(c);refresh();
  104.         str[i] = c ;
  105.         str[i+1]='\0';
  106.         break;
  107. }
  108.  
  109. è